package ch.unifr.dokpe.htmlpicker.urlformater;

public class DefaultUrlFormater extends AbstractUrlFormater {


/**
* Replace each space in the String received in param by the value from url_connect
*/

public String formatUrl(String url, String param, int searchNo){
	//String[] words = fields[first + i].split("\\s");
	String[] words = param.split("\\s");
	String tmp;
	StringBuffer urlTotal = new StringBuffer();
	//int no = searchNo.intValue();
	for (String w : words){
		tmp = url.replaceAll(count_symb, Integer.toString(searchNo));
		urlTotal.append((searchNo==1?"":connect) + tmp.replaceFirst(param_symb, w));
	}
	//searchNo = new Integer(no);
	return urlTotal.toString();
}

}
